package com.asiainfo.fc.model;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

public class HistoryDataRender extends DefaultTableCellRenderer {

	/**
	 * HistoryDataRender
	 */
	private static final long serialVersionUID = -2792230757729892653L;

	public HistoryDataRender() {
		setHorizontalAlignment(JLabel.CENTER);

	}

	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {
		if (column == 0) {
			super.setForeground(Color.LIGHT_GRAY);
		} else if (column == 9) {
			super.setForeground(Color.blue);
		} else if (column > 2 && column < 9) {
			super.setForeground(Color.red);
		} else {
			super.setForeground(Color.BLACK);
		}

		return super.getTableCellRendererComponent(table, value, isSelected,
				hasFocus, row, column);
	}
}
